home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 22 / AACD 22.iso / AACD / Online / Apache / include / php / Zend / zend_static_allocator.h < prev    next >
Encoding:
C/C++ Source or Header  |  2000-07-02  |  1.7 KB  |  46 lines

  1. /*
  2.    +----------------------------------------------------------------------+
  3.    | Zend Engine                                                          |
  4.    +----------------------------------------------------------------------+
  5.    | Copyright (c) 1998-2000 Zend Technologies Ltd. (http://www.zend.com) |
  6.    +----------------------------------------------------------------------+
  7.    | This source file is subject to version 0.92 of the Zend license,     |
  8.    | that is bundled with this package in the file LICENSE, and is        |
  9.    | available at through the world-wide-web at                           |
  10.    | http://www.zend.com/license/0_92.txt.                                |
  11.    | If you did not receive a copy of the Zend license and are unable to  |
  12.    | obtain it through the world-wide-web, please send a note to          |
  13.    | license@zend.com so we can mail you a copy immediately.              |
  14.    +----------------------------------------------------------------------+
  15.    | Authors: Andi Gutmans <andi@zend.com>                                |
  16.    +----------------------------------------------------------------------+
  17. */
  18.  
  19. #ifndef ZEND_STATIC_ALLOCATOR_H
  20. #define ZEND_STATIC_ALLOCATOR_H
  21.  
  22. #define ALLOCATOR_BLOCK_SIZE 400000
  23.  
  24. /* Temporary */
  25. typedef unsigned int zend_uint;
  26. #define emalloc(s) malloc(s)
  27. #define efree(p) free(p)
  28.  
  29. typedef struct _Block {
  30.     char *bp;
  31.     char *pos;
  32.     char *end;
  33. } Block;
  34.  
  35. typedef struct _StaticAllocator {
  36.     Block *Blocks;
  37.     zend_uint num_blocks;
  38.     zend_uint current_block;
  39. } StaticAllocator;
  40.  
  41. void static_allocator_init(StaticAllocator *sa);
  42. char *static_allocator_allocate(StaticAllocator *sa, zend_uint size);
  43. void static_allocator_destroy(StaticAllocator *sa);
  44.  
  45. #endif /* ZEND_STATIC_ALLOCATOR_H */
  46.